
function sendXMPP(msg)
{	
    try
    {
XMPP.send(
{
        jid: 'harini@ubuntu', 
        password: '123'
 }


 ,<message to="synchrona@ubuntu"><body>{msg}</body></message>);
}
catch (e2)
{
alert(e2.toString());
}
}

function receiveXMPP(message) {
	var sender = message.stanza.@from;
	var body = message.stanza.body.toString();
	var array = body.split("Site\">");
	array = array[1].split("<");
	var site = array[0];
	var service =""; var sts=""; var msg =null;
	if(site.indexOf("facebook.com/ajax/updatestatus.php")!=-1)//fb update
	{
		service = "Facebook";
		array = body.split("Data\">");
		array = array[1].split("<");
		sts = array[0];
		msg = sts+"\n\n"+sender+" via "+service;
		var fbLblMsg = document.getElementById('fbLblMsg');
		fbLblMsg.value = sts+"\n";
		var fbLblFrm = document.getElementById('fbLblFrm');
		fbLblFrm.value = sender+"\n";
	}
	else if(site.indexOf("twitter.com/status/update")!=-1)//bg update
	{
		service = "Twitter";
		array = body.split("Data\">");
		array = array[1].split("<");
		sts = array[0];
		msg = sts+"\n\n"+sender+" via "+service;
		var twLblMsg = document.getElementById('twLblMsg');
		twLblMsg.value = sts+"\n";
		var twLblFrm = document.getElementById('twLblFrm');
		twLblFrm.value = sender+"\n";
	}
	else if(site.indexOf("www.blogger.com/post-create.do")!=-1)//tw update
	{
		service = "Blogger";
		array = body.split("Data\">");
		array = array[1].split("<");
		sts = array[0];
		//array = body.split("PostUrl\">");
		//array = array[1].split("<");
		//var postUrl = array[0];
		msg = sts+"\n\n"+sender+" via "+service;
		var bgLblMsg = document.getElementById('bgLblMsg');
		bgLblMsg.value = sts+"\n";
		var bgLblFrm = document.getElementById('bgLblFrm');
		bgLblFrm.value = sender+"\n";
	}
if(msg!=null)
{
	alert(msg);
}
}




